{% extends 'cms/cms_base.html' %}

{% block title %}
    用户中心
{% endblock %}

{% block page_title %}
    用户信息
{% endblock %}

{% block main_content %}
    {% set user = g.cms_user %}
    <div style="padding-right: 70%">
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td width="90px">用户名：</td>
                    <td>{{ user.username }}</td>
                </tr>
                <tr>
                    <td>邮箱：</td>
                    <td>{{ user.email }}</td>
                </tr>
                <tr>
                    <td>手机号：</td>
                    {% if user.mobile %}
                        <td>{{ user.mobile[:3] }}*****{{ user.mobile[8:] }}</td>
                    {% else %}
                        <td>无</td>
                    {% endif %}
                </tr>
                <tr>
                    <td>角色：</td>
                    <td>
                        {% for role in user.roles %}
                            {{ role.name }}
                            {% if not loop.last %}，{% endif %}
                        {% endfor %}
                    </td>
                </tr>
                <tr>
                    <td>权限：</td>
                    <td>
                        {% for role in user.roles %}
                            {{ role.desc }}
                            {% if not loop.last %}；{% endif %}
                        {% endfor %}
                    </td>
                </tr>
                <tr>
                    <td>加入时间：</td>
                    <td>{{user.join_time}}</td>
                </tr>
            </tbody>
        </table>
    </div>
{% endblock %}